package net.maku.events.service;

import net.maku.events.vo.AlreadyAnswerQuestionBankVO;
import net.maku.events.vo.UserAnswerQuestionBankVO;
import net.maku.framework.common.utils.PageResult;
import net.maku.framework.mybatis.service.BaseService;
import net.maku.events.vo.UserContestQuestionVO;
import net.maku.events.query.UserContestQuestionQuery;
import net.maku.events.entity.UserContestQuestionEntity;

import java.util.List;

/**
 * 用户所答竞赛
 *
 * @author 阿沐 babamu@126.com
 * @since 1.0.0 2025-03-22
 */
public interface UserContestQuestionService extends BaseService<UserContestQuestionEntity> {

    PageResult<UserContestQuestionVO> page(UserContestQuestionQuery query);

    /**
     * 答题
     *
     * @param businessId   业务id
     * @param businessType 业务类型 0 知识竞赛  1 答题竞赛健步走站点
     * @param voList       答题对象数组
     */
    double save(Long relationId, Long relationSonId, Long businessId, Integer businessType, List<UserAnswerQuestionBankVO> voList);

    /**
     * 获取自己已经答题的活动id
     *
     * @param businessIdList 活动id
     * @param businessType   活动类型
     * @return 结果
     */
    List<Long> getAlreadyAnswerIdList(List<Long> businessIdList, Integer businessType);

    /**
     * 查看已经答题的题目
     *
     * @param businessId     活动id
     * @param businessType   活动类型
     * @param questionIdList 题目id数组
     * @return 结果
     */
    List<AlreadyAnswerQuestionBankVO> getAlreadyAnswer(Long relationId, Long relationSonId,boolean today, Long businessId, Integer businessType, List<Long> questionIdList);
}